﻿using B.S.BaseData.Domain.Entities.RBAC;
using B.S.BaseData.ErrorCode;
using B.S.DataBase.EFCoreServiers.Dtos.Depts;
using B.S.DataBase.EFCoreServiers.Dtos.Permissions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B.S.DataBase.EFCoreServiers.IServices.Permissions
{
    public interface IPermissionServices
    {
        /// <summary>
        /// 添加权限
        /// </summary>
        /// <param name="permissionDto">权限数据传输对象</param>
        /// <returns>操作结果</returns>
        Task<ApiResult> AddPermissiontAsync(AddPermissionDto permissionDto);
        /// <summary>
        /// 角色的权限树形结构
        /// </summary>
        /// <param name="roleId"></param>
        /// <returns></returns>
        Task<ApiResult<IList<PermissionTree>>> GetPermissiontAsync(int roleId);



        /// <summary>
        /// 获取所有权限
        /// </summary>
        /// <returns></returns>
        Task<ApiResult<IList<GetAllPermissiontDto>>> GetAllPermissiontAsync();

        /// <summary>
        /// 修改角色权限
        /// </summary>
        /// <param name="modifyRolePermissionsDto">包含角色ID和权限ID列表的数据传输对象</param>
        /// <returns>操作结果</returns>
        Task<ApiResult> ModifyRolePermissionsAsync(ModifyRolePermissionsDto modifyRolePermissionsDto);
        /// <summary>
        /// 获取菜单权限的树形
        /// </summary>
        /// <returns></returns>
        Task<ApiResult<IList<GetMenuPermissionTree>>> GetMenuPermission(int ParentId = 0);
    }
}
